<template>
    <div>
        <button @click="toOtherPage">跳转到/DemoVhtml</button>
    </div>
</template>

<script>
    export default {
        name: "DemoRoute",
        data() {
            return {}
        },
        methods: {
            toOtherPage() {

                //router.push({ path: `/user/${userId}` }) // -> /user/123




                // 带查询参数，变成 /register?plan=private
                this.$router.push({
                    path: '/DemoVhtml',
                    query: { plan: 'private' }

                })
            }
        },
        mounted() {
            console.log('----接收的路由参数---------------------')
            console.log(this.$route.params)
            // this.$route.params.userId;
        }
    }
</script>

<style scoped>

</style>
